package cn.edu.fzu.delivery.domain.enums;

/**
 * 用户类型
 *
 * @author fangxin
 * @date 2022/11/2
 */
public enum UserTypeEnum implements SpringConvertibleEnum {

    EXPRESS(1, "快递员"),
    NET_ADMIN(2, "网点管理员"),
    SUPER_ADMIN(3, "系统管理员");

    private final int    value;

    private final String desc;

    private UserTypeEnum(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }


    public int getValue() {
        return value;
    }


    public String getDesc() {
        return desc;
    }


    public static UserTypeEnum parse(int value) {
        switch (value) {
            case 1:
                return EXPRESS;
            case 2:
                return NET_ADMIN;
            case 3:
                return SUPER_ADMIN;
            default:
                return null;
        }
    }


    @Override
    public String toString() {
        return String.valueOf(getValue());
    }
}
